/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rafrau
 */
@Entity
@Table(name = "bib", catalog = "idlbbd", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Bib.findAll", query = "SELECT b FROM Bib b"),
    @NamedQuery(name = "Bib.findByIdBib", query = "SELECT b FROM Bib b WHERE b.idBib = :idBib"),
    @NamedQuery(name = "Bib.findByCapBib", query = "SELECT b FROM Bib b WHERE b.capBib = :capBib"),
    @NamedQuery(name = "Bib.findByVerBib", query = "SELECT b FROM Bib b WHERE b.verBib = :verBib"),
    @NamedQuery(name = "Bib.findByLibBib", query = "SELECT b FROM Bib b WHERE b.libBib = :libBib"),
    @NamedQuery(name = "Bib.findByVersBib", query = "SELECT b FROM Bib b WHERE b.versBib = :versBib")})
public class Bib implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "id_bib", nullable = false)
    private int idBib;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cap_bib", nullable = false)
    private int capBib;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ver_bib", nullable = false)
    private int verBib;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "lib_bib", nullable = false, length = 50)
    private String libBib;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 65535)
    @Column(name = "cont_bib", nullable = false, length = 65535)
    private String contBib;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "vers_bib", nullable = false, length = 50)
    private String versBib;

    public Bib() {
    }

    public Bib(String versBib) {
        this.versBib = versBib;
    }

    public Bib(String versBib, int idBib, int capBib, int verBib, String libBib, String contBib) {
        this.versBib = versBib;
        this.idBib = idBib;
        this.capBib = capBib;
        this.verBib = verBib;
        this.libBib = libBib;
        this.contBib = contBib;
    }

    public int getIdBib() {
        return idBib;
    }

    public void setIdBib(int idBib) {
        this.idBib = idBib;
    }

    public int getCapBib() {
        return capBib;
    }

    public void setCapBib(int capBib) {
        this.capBib = capBib;
    }

    public int getVerBib() {
        return verBib;
    }

    public void setVerBib(int verBib) {
        this.verBib = verBib;
    }

    public String getLibBib() {
        return libBib;
    }

    public void setLibBib(String libBib) {
        this.libBib = libBib;
    }

    public String getContBib() {
        return contBib;
    }

    public void setContBib(String contBib) {
        this.contBib = contBib;
    }

    public String getVersBib() {
        return versBib;
    }

    public void setVersBib(String versBib) {
        this.versBib = versBib;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (versBib != null ? versBib.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bib)) {
            return false;
        }
        Bib other = (Bib) object;
        if ((this.versBib == null && other.versBib != null) || (this.versBib != null && !this.versBib.equals(other.versBib))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Bib[ versBib=" + versBib + " ]";
    }
    
}
